package core;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: lahiru
 * Date: 3/26/14
 * Time: 1:08 PM
 * To change this template use File | Settings | File Templates.
 */
public class Speaker implements Serializable {
    private String id;
    private Map<Integer, Phone> phones = new HashMap<Integer, Phone>();

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Map<Integer, Phone> getPhones() {
        return phones;
    }

    public void setPhones(Map<Integer, Phone> phones) {
        this.phones = phones;
    }

    public void addFrameStats(int phoneId, String[] hiddenActivations) {
        if (phones.keySet().contains(phoneId)) {
            phones.get(phoneId).addActivations(hiddenActivations);
        } else {
            Phone phone = new Phone(hiddenActivations, 1, phoneId);
            phones.put(phoneId, phone);
        }
    }
}
